package models;

import java.util.*;
import javax.persistence.*;

import play.Logger;
import play.db.ebean.*;
import play.data.format.*;
import play.data.validation.*;

/**
 * User entity managed by Ebean
 */
@Entity
@Table(name="MovieSession")
public class MovieSession extends Model {

	@Id
	public Long id;

	public Long lang;
	public Float price;


	public Date showtime;

    @OneToOne
	public House house;

	@ManyToOne
	public Movie movie;



    // -- Queries
    public static Model.Finder<Long,MovieSession> find = new Model.Finder(Long.class, MovieSession.class);

	public static MovieSession findById(Long id, String language){
		return find.fetch("movie.infos").where().eq("id",id).eq("locale",language).findUnique();
	}
	

}

